﻿using CIS.Client.Common.HttpRequestHelper;
using CIS.Client.Modules.Home;
using CIS.Client.Modules.Main;
using CIS.Client.Modules.Operation;
using CIS.Client.ViewModels;
using DryIoc;
using log4net;
using MediatR;
using Prism.DryIoc;
using Prism.Ioc;
using Prism.Modularity;
using System.Configuration;
using System.Data;
using System.Windows;

namespace CIS.Client
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : PrismApplication
    {
        protected override Window CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<MainWindow, MainWindowViewModel>();
            //Api 请求
            containerRegistry.Register<HttpRequestClient>();
            //.Register<HttpRequestClient>(made:Parameters.Of.Type<string>(serviceKey:"webUrl"));

            containerRegistry.RegisterSingleton<IMediator, Mediator>();
        }

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            base.ConfigureModuleCatalog(moduleCatalog);
            moduleCatalog.AddModule<OperationModule>();
            moduleCatalog.AddModule<MainModule>();
            moduleCatalog.AddModule<HomeModule>();
        }
    }

}
